]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellMountOperation: Move password entry to a grid
authorsegfault <segfault@riseup.net>
Sun, 7 Apr 2019 21:33:34 +0000 (23:33 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 20 May 2019 17:59:04 +0000 (19:59 +0200)
This prepares for additional UI elements added for TCRYPT support.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/126

data/theme/gnome-shell-sass/_common.scss
js/ui/shellMountOperation.js

index 67e5954cb48bd4943232ea79cf7d4b466a891dd0..e31f263de8f6593194cb07178f2b43edba62878a 100644 (file)
@@ -405,6 +405,11 @@ StScrollBar {
     padding-bottom: 8px;
   }
 
+  .prompt-dialog-grid {
+    spacing-rows: 15px;
+    spacing-columns: 1em;
+  }
+
 
 /* Polkit Dialog */
 
index f976f400f48acd0cb1753017547be894c6a708af..ac27de2e88a5b13d1940ad597f74634072d241af 100644 (file)
@@ -289,22 +289,34 @@ var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
         let content = new Dialog.MessageDialogContent({ icon, title, body });
         this.contentLayout.add_actor(content);
 
-        this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
-        content.messageBox.add(this._passwordBox);
+        let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
+        let grid = new St.Widget({ style_class: 'prompt-dialog-grid',
+                                   layout_manager: layout });
+        layout.hookup_style(grid);
 
-        this._passwordLabel = new St.Label(({ style_class: 'prompt-dialog-password-label',
-                                              text: _("Password") }));
-        this._passwordBox.add(this._passwordLabel, { y_fill: false, y_align: St.Align.MIDDLE });
+        let rtl = grid.get_text_direction() === Clutter.TextDirection.RTL;
 
+        this._passwordLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
+                                             text: _("Password"),
+                                             y_align: Clutter.ActorAlign.CENTER });
         this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
-                                             text: "",
-                                             can_focus: true});
-        ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+                                             can_focus: true,
+                                             x_expand: true});
         this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
         this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
-        this._passwordBox.add(this._passwordEntry, {expand: true });
+        ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
         this.setInitialKeyFocus(this._passwordEntry);
 
+        if (rtl) {
+            layout.attach(this._passwordEntry, 0, 0, 1, 1);
+            layout.attach(this._passwordLabel, 1, 0, 1, 1);
+        } else {
+            layout.attach(this._passwordLabel, 0, 0, 1, 1);
+            layout.attach(this._passwordEntry, 1, 0, 1, 1);
+        }
+
+        content.messageBox.add(grid);
+
         this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label',
                                                  text: _("Sorry, that didn’t work. Please try again.") });
         this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;